package com.ldu.houserent.common.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
    分页配置类
 */
@Configuration
public class MybatisPlusConfig {
    /*
        mybatisPlus分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){   //使用该插件后，可以进行带查询条件的分页查询QueryWrapper
        return new PaginationInterceptor();
    }

    /*
        在控制台输出sql，方便调试
     */
    @Bean
    public PerformanceInterceptor performanceInterceptor(){
        return new PerformanceInterceptor();
    }

}
